<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script src="../../common/js/jquery-1.7.1.js"></script>
    <script type="text/javascript">
    	    	$(function(){
    				
    		
    	            //将苹果替换成菠萝
    	          $("div:eq(1)").replaceWith("<div class='third'>菠萝</div>") ;
    	            //将菠萝替换成苹果
    	           $("div:eq(3)").replaceWith("<div class='first'>苹果</div>") ;
    	            //将苹果替换成菠萝
    				/* $("div:eq(3)").replac																					eWith("<div class='first'>苹果</div>") ;*/
    		})
    	    </script>
            //将苹果替换成菠萝
          
            //将菠萝替换成苹果
           
            //将苹果替换成菠萝

</head>

<body>
    <h3>例子</h3>
    <div class="container">
        <div class="first">苹果</div>
        <div class="second">橘子</div>
        <div class="third">菠萝</div>
    </div>
</body>
</html>
